import * as actionTypes from './constants';

const defaultState = {
  artist: {},
  songs: [],
  enterLoading: true
}

export default (state = defaultState, action) => {
    switch(action.type) {
      case actionTypes.CHANGE_ARTIST:
        return {
            ...state,
            artist:action.data
        }
      case actionTypes.CHANGE_SONGS_OF_ARTIST:
        return {
            ...state,
            songs:action.data
        }
      case actionTypes.CHANGE_ENTER_LOADING:
        return {
            ...state,
            enterLoading:action.data
        }
      default:
        return state;
    }
  }